<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>退货单添加</title>
    <style>
        .box{
            width: 100%;

        }
        .box1{
            width: 100%;
            height: 50px;
            background: lavender;
        }
        .btn{
            background: orange;
            color: white;
            border: 0;
            width: 80px;
            height: 30px;
            border-radius: 5px;
        }
        .liang{
            background: crimson;
            color: white;
            border: 0;
            width: 100px;
            height: 30px;
            line-height: 30px;
            border-radius: 5px;
            margin: 10px;
        }
        .sou{
            width: 150px;
            height: 20px;
            border-radius: 3px;
            margin: 10px;
        }
        table{
            margin-top: 15px;
            width: 100%;
            border-collapse: collapse;
            text-align: center;
        }
        th{
            border: 1px solid silver;
        }
        th:active{color: red}
        th:hover{color: red}
        td{
            border: 1px solid silver;
        }
        .kuang{
            margin-left:30%;
            font-family: 宋体;
            font-size: 14px;
            font-weight:bold;
        }
        .lyy{
            width: 1000px;
            height: 30px;
            margin-top: 22%;
            margin-left: 48%;
        }
        .sb{
            border: 0;
            background: #2D93CA;
            margin-top: -3px;
            width: 70px;
            height: 30px;
            border-radius: 5px;
        }
        .zhuan1{
            width: 50px;
            height: 20px;
        }
        .zhuan2{
            border: solid;
            color: #2D93CA;
            font-weight: bold;
            font-size: 20px;
            background: transparent;

            border: 0;
        }
        .dao{
            font-family: 黑体;
            font-size: 17px;
        }
        .touxinxi{
            font-size: 16px;
        }
        .danzi{
            width: 130px;
            height: 22px;
            margin:15px;
            background-color: rgba(222,222,222,0.9);
            border-radius: 8px;
            border:1px solid #378888;
        }
        .tan{
            display: none;
            width: 700px;
            height: 500px;
            margin-left: 370px;
            margin-top: 40px;
            border-radius:30px;
            background-color: rgba(85, 162, 162, 0.9);
            font-size: 17px;
        }
        .cuo{
            margin-left: 94%;
            margin-top: 1px;
            font-size: 35px;
            background:transparent;border:0;
        }
        .nei{
            padding-left: 25px;
        }
    </style>
    <script src="/resources/js/jquery-1.7.1.min.js" type="application/javascript"></script>
    <script src="/resources/js/jquery-ui-1.8.10.custom.min.js" type="text/css"></script>
</head>
        <script>
            $(function () {
                readList(1);
                $(document).ready(function () {
                    var time = new Date();
                    var day = ("0" + time.getDate()).slice(-2);
                    var month = ("0" + (time.getMonth() + 1)).slice(-2);
                    var today = time.getFullYear() + "-" + (month) + "-" + (day);
                    $('#date_info').val(today);
                })


            });
            var da = "";
            var hospitalId;
            $.ajax({
                url:"getSessionUnitId",
                type:"post",
                dataType:"json",
                success:function (data) {
                    hospitalId = data;
                }
            })
            function readList(pageNum) {
                if(pageNum == 0){
                    pageNum = 1
                }
                var form = $("#form1")[0];
                var formData= new FormData(form);
                formData.append("pageNum",pageNum);
                formData.append("hospitalId",hospitalId);
                $.ajax({
                    url:"/selectGoodsNote",
                    data:formData,
                    dataType:"json",
                    type:"post",
                    processData:false,
                    contentType:false,
                    success:function (data) {
                        da = data;
                        var table = "";
                        var list = data.list;
                        $("#table").empty();
                        for(var i = 0 ; i < list.length;i++){
                            var zhi = list[i];
                            $("input[id='salesName']").val(zhi.hospitalName+zhi.createTime+"退货单");
                            $("input[id='hospitalName']").val(zhi.hospitalName);
                            $("input[id='hospitalId']").val(zhi.hospitalId);
                            if(zhi.createName == null || zhi.createName == ''){
                                zhi.createName = '';
                            }
                            table += '<tr>' +
                                '<td>'+zhi.id+'</td>'+
                                '<td>'+zhi.outputNum+'</td>'+
                                '<td>'+zhi.hospitalName+zhi.createTime+'</td>'+
                                '<td>'+zhi.hospitalName+'</td>'+
                                '<td>'+zhi.createName+'</td>'+
                                '<td>'+zhi.createTime+'</td>'+
                                '<td>'+zhi.submitTime+'</td>'+
                                '<td>'+zhi.remark+'</td>'+
                                '<td>'+zhi.dataName+'</td>'+
                                '</tr>'
                        }
                        $("#table").append(table);

                    }
                })

            }



        </script>
<body>
<div class="box" >
    <h3>创建退货单</h3>
    <hr>
    <form action="" method="post" id="form1">
        <div class="kuang">
            建单时间：
            <input type="date" class="sou" name="createTime">
            &nbsp;
            医院名称：
            <input type="text" placeholder="请输入医院名称" class="sou" name="hospitalName">
            <br/>
            退货单编号
            <input type="text" placeholder="请输入退货单编号" class="sou" name="outputNum">
            退货单名称：
            <input type="text" placeholder="请输入退货单名称" class="sou" name="outputName">
            <br/>
            退货单状态:
            <select class="sou" name="dataNum">
                <option value="">全部</option>
                <option value="1">未提交</option>
                <option value="2">已提交至供货商</option>
            </select>
            &nbsp;
            退货时间：
            <input type="date" class="sou" name="submitTime">
        </div>
    </form>
</div>
<div class="box1">
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;<button class="liang" onclick="readList(1)">查询</button>
</div>
<table id="mailInfoTable">
    <thead class="touxinxi">
    <tr>
        <th>序号</th>
        <th>退货单编号</th>
        <th>退货单名称</th>
        <th>医院名称</th>
        <th>建单人</th>
        <th>建单时间</th>
        <th>提交时间</th>
        <th>备注</th>
        <th>退货状态</th>
    </tr>
    </thead>
    <tbody id="table">

    </tbody>
</table>
<div class="lyy" style="margin: 10px">
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <button class="sb" onclick="readList(1)">首页</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <button class="sb" onclick="readList(da.prePage)">上一页</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <button class="sb" onclick="readList(da.nextPage)">下一页</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <button class="sb" onclick="readList(da.pages)">尾页</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <span class="dao">转到</span><input class="zhuan1" name="zhuan" type="text"><span class="dao">页</span><button class="zhuan2"><span class="jian" onclick="jian()">⇨</span></button>
</div>
</body>
</html>